<template>
    <div>
            <van-field v-model="name" label="名称" placeholder="请输入用户名" id="name"/>
            <van-button @click='add' id="add" color="green">添加</van-button>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                name: ''
            }
        },
        methods: {
            add() {
                this.axios.post('cateM', {
                    'name': this.name
                }).then(res => {
                    alert('添加成功')
                })
            }
        },
    }
</script>

<style lang="">

</style>
